home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 - Homepage / CHIP.BIN / share / webmaste / csehtmlp / csehtmlp.exe / {app} / ParserRules / php_in_html.xs < prev    next >
Encoding:
Text File  |  2002-04-22  |  5.4 KB  |  157 lines

  1. //Language: Perl in HTML
  2. //Copyright (c) 1992-2002 Altium Limited             
  3. //All rights reserved.                               
  4. //http://www.dream-com.com                           
  5. //contact@dream-com.com                              
  6.  
  7. // states
  8. State=snormal
  9. State=sstring1
  10. State=sstring2
  11. State=sstring3
  12. State=sstring4
  13. State=sstring5
  14. State=scomment1
  15. State=scomment2
  16. State=scomment3
  17. State=scomment4
  18. State=shtmltag
  19. State=shtmlPHP
  20. // tokens
  21. Token=tnone
  22. Token=tstring
  23. Token=tcomment
  24. Token=tident
  25. Token=tinteger
  26. Token=tfloat
  27. Token=tresword
  28. Token=tassembler
  29. Token=turl
  30. Token=twhitespace
  31. Token=tresword1
  32. //delims
  33. Delimiters=;.,:'"{}[]()?!@#$%^&*-+=|\/
  34.  
  35.  
  36. //Common
  37. snormal <                          shtmltag  tresword1
  38. shtmltag [^\>^\'^\"^\0-9^#32^\=][^\>^\'^\"^#32^\=]* shtmltag  tresword1
  39. shtmltag >                         snormal   tresword1
  40.  
  41.  
  42. //white space
  43. snormal #32*                      snormal   twhitespace
  44.  
  45.  
  46. //strings
  47. shtmltag   \'                     sstring1   tstring
  48. sstring1   [^\']*                 sstring1   tstring
  49. sstring1   \'                     shtmltag   tstring
  50. sstring1   \'\'                   sstring1   tstring
  51. sstring1   $                      shtmltag   tstring
  52.  
  53. shtmltag    \"                    sstring2   tstring
  54. sstring2   [^\"]*                 sstring2   tstring
  55. sstring2   \"                     shtmltag   tstring
  56. sstring2   \"\"                   sstring2   tstring
  57. sstring2   $                      shtmltag   tstring
  58.  
  59.  
  60. // numbers
  61. shtmltag [0-9][0-9]*              shtmltag  tinteger
  62. shtmltag \#[0-9A-F]+              shtmltag  tinteger
  63. shtmltag [1-9][0-9]*\.[0-9]*                    shtmltag  tfloat
  64. shtmltag [1-9][0-9]*{\.[0-9]+}|e{[\+\-]}|[0-9]+ shtmltag   tfloat
  65.  
  66.  
  67. //comments
  68. shtmltag   <\!--                    scomment1 tcomment
  69. scomment1 [^\-]*                   scomment1 tcomment
  70. scomment1  -->                     shtmltag   tcomment
  71.  
  72. // reswords
  73. shtmlPHP 'break'        shtmlPHP tresword
  74. shtmlPHP 'case'         shtmlPHP tresword
  75. shtmlPHP 'class'        shtmlPHP tresword
  76. shtmlPHP 'continue'     shtmlPHP tresword
  77. shtmlPHP 'default'      shtmlPHP tresword
  78. shtmlPHP 'do'           shtmlPHP tresword
  79. shtmlPHP 'else'         shtmlPHP tresword
  80. shtmlPHP 'elseif'       shtmlPHP tresword
  81. shtmlPHP 'endfor'       shtmlPHP tresword
  82. shtmlPHP 'endif'        shtmlPHP tresword
  83. shtmlPHP 'endswitch'    shtmlPHP tresword
  84. shtmlPHP 'endwhile'     shtmlPHP tresword
  85. shtmlPHP 'extends'      shtmlPHP tresword
  86. shtmlPHP 'for'          shtmlPHP tresword
  87. shtmlPHP 'function'     shtmlPHP tresword
  88. shtmlPHP 'global'       shtmlPHP tresword
  89. shtmlPHP 'if'           shtmlPHP tresword
  90. shtmlPHP 'int'          shtmlPHP tresword
  91. shtmlPHP 'old_function' shtmlPHP tresword
  92. shtmlPHP 'pval'         shtmlPHP tresword
  93. shtmlPHP 'return'       shtmlPHP tresword
  94. shtmlPHP 'static'       shtmlPHP tresword
  95. shtmlPHP 'string'       shtmlPHP tresword
  96. shtmlPHP 'switch'       shtmlPHP tresword
  97. shtmlPHP 'var'          shtmlPHP tresword
  98. shtmlPHP 'void'         shtmlPHP tresword
  99. shtmlPHP 'while'        shtmlPHP tresword
  100.  
  101. //idents
  102. shtmlPHP   [a-z_A-Z][a-z_A-Z0-9]*  shtmlPHP   tident
  103.  
  104. // numbers
  105. shtmlPHP [0-9][0-9]*              shtmlPHP  tinteger
  106. shtmlPHP 0x[0-9A-F]+              shtmlPHP  tinteger
  107. shtmlPHP [1-9][0-9]*\.[0-9]*                    shtmlPHP  tfloat
  108. shtmlPHP [1-9][0-9]*{\.[0-9]+}|e{[\+\-]}|[0-9]+ shtmlPHP   tfloat
  109.  
  110. //strings
  111. shtmlPHP  \'                     sstring3   tstring
  112. sstring3  [^\']*                 sstring3   tstring
  113. sstring3  \'                     shtmlPHP   tstring
  114. sstring3  \'\'                   sstring3   tstring
  115. sstring3   \\                    sstring3   tstring
  116. sstring3   \\\'                  sstring3   tstring
  117. sstring3  $                      shtmlPHP   tstring
  118.  
  119. shtmlPHP  \"                     sstring4   tstring
  120. sstring4  [^\"]*                 sstring4   tstring
  121. sstring4  \"                     shtmlPHP   tstring
  122. sstring4  \"\"                   sstring4   tstring
  123. sstring4   \\                    sstring4   tstring
  124. sstring4   \\\"                  sstring4   tstring
  125. sstring4  $                      shtmlPHP   tstring
  126.  
  127. shtmlPHP    \`                    sstring5   tstring
  128. sstring5   [^\`]*                 sstring5   tstring
  129. sstring5   \`                     shtmlPHP   tstring
  130. sstring5   \`\`                   sstring5   tstring
  131. sstring5   \\                     sstring5   tstring
  132. sstring5   \\\`                   sstring5   tstring
  133. sstring5   $                      shtmlPHP   tstring
  134.  
  135. //comments
  136. shtmlPHP   //                      scomment2  tcomment
  137. scomment2  [#1-#255]*              shtmlPHP   tcomment
  138. scomment2 $                        shtmlPHP   tcomment
  139.  
  140. shtmlPHP   \#                      scomment3  tcomment
  141. scomment3  [#1-#255]*              shtmlPHP   tcomment
  142. scomment3 $                        shtmlPHP   tcomment
  143.  
  144. shtmlPHP   /\*                     scomment4  tcomment
  145. scomment4  [^\*]*                  scomment4  tcomment
  146. scomment4  \*[^/]                  scomment4  tcomment
  147. scomment4  [\*]*/                  shtmlPHP   tcomment
  148.  
  149. //PHP
  150. snormal  <?                        shtmlPHP  tresword
  151. shtmlPHP ?>                        snormal   tresword
  152.  
  153. snormal  <%                        shtmlPHP  tresword
  154. shtmlPHP %>                        snormal   tresword
  155.  
  156. snormal  <script#32language="php">   shtmlPHP  tresword
  157. shtmlPHP </script>                   snormal   tresword